﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DotNetMigrations.Commands
{
	/// <summary>
	/// Base class for all console commands.
	/// </summary>
	public abstract class ConsoleCommand
	{
		protected readonly string[] Args;
		protected readonly int ArgCount;

		public ConsoleCommand(string[] args)
		{
			Args = args;
			ArgCount = args.GetLength(0);
		}

		/// <summary>
		/// Validate the arguments passed to the command.
		/// </summary>
		/// <returns>True/False whether the arguments are valid for this command.</returns>
		public abstract bool ValidateArgs();

		/// <summary>
		/// Execute the command.
		/// </summary>
		public abstract bool Run();
	}
}
